
import * as echarts from 'echarts';
var  chart1 ={
  tooltip: {
    trigger: 'item',
    formatter: '{a} <br/>{b}: {c} ({d}%)'
  },
  legend: {
    data: [
      '1T使用',
      '1T空闲',
      '2T使用',
      '2T空闲'
    ]
  },
  series: [
    {
      name: '总库位',
      type: 'pie',
      selectedMode: 'single',
      radius: [0, '30%'],
      label: {
        position: 'inner',
        fontSize: 14
      },
      labelLine: {
        show: false
      },
      data: [
        { value: 1548, name: '1T库位' 
        },
        { value: 679, name: '2T库位', selected: true }
      ]
    },
    {
      name: '库位使用率',
      type: 'pie',
      radius: ['45%', '60%'],
      labelLine: {
        length: 1
      },
      label: {
        formatter: '{b|{b}:}{c}  {per|{d}%}  ',
        backgroundColor: '#F6F8FC',
        borderColor: '#8C8D8E',
        borderWidth: 1,
        borderRadius: 1,
        rich: {
          b: {
            color: '#4C5058',
            fontSize: 14,
            fontWeight: 'bold',
            lineHeight: 20
          },
          per: {
            color: '#fff',
            backgroundColor: '#4C5058',
            padding: [1, 1],
            borderRadius: 4
          }
        }
      },
      data: [
        { value: 1000, name: '1T使用' },
        { value: 548, name: '1T空闲' },
        { value: 500, name: '2T使用' },
        { value: 179, name: '2T空闲' }
      ]
    }
  ]
};

var chart2 = {
  title: {
      text: '     领料/来料统计'
  },
  tooltip: {
      trigger: 'axis',
      axisPointer: {            // 坐标轴指示器，坐标轴触发有效
          type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
      }
  },
  legend: {
      data: ['计划领料量', '来料量'],
      padding: [0, 0, 15, 0] //图例距离
  },
  grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      top:'13%',
      containLabel: true
  },
  xAxis: [
      {
          type: 'category',
          data: [ '200305010001', '200305010002', '200305010003', '200305010004', '200305010005', '200305010006', '200305010007','200305010008','200305010009']
      }
  ],
  yAxis: [
      {
          type: 'value'
      }
  ],
  series: [
      {
          name: '计划领料量',
          type: 'bar',
          showBackground: true,
          backgroundStyle: {
              color: 'rgba(180, 180, 180, 0.2)'
          },
          itemStyle: {

              normal: {
                  barBorderRadius: [4, 4, 0, 0]
              }
          },
          data: [ 225, 226, 225, 227, 235, 221, 225,226,239,229]
      },
      {
          name: '来料量',
          type: 'bar',

          showBackground: true,
          backgroundStyle: {
              color: 'rgba(180, 180, 180, 0.2)'
          },
          data: [224.3, 225.7, 225.1, 226.8, 234.8, 230.5, 224.6,225.8,238.6,228.3]
      }
  ]
}
var chart3 = {
  title: {
      text: 'xxxx',
      left: 'center'
  },
  tooltip: {
      trigger: 'item'
  },
  legend: {
      top: 'bottom',
      icon: "circle",   //  这个字段控制形状  类型包括 circle，rect ，roundRect，triangle，diamond，pin，arrow，none
      itemWidth: 10,  // 设置宽度
      itemHeight: 10, // 设置高度
      itemGap: 7,// 设置间距
      padding: [0, 0, 10, 0] //图例距离
  },
  series: [
      {

          name: '框架支持功能(Vue2.0、Vue3版本)',
          type: 'pie',
          radius: '55%',
          data: [
              { value: 748, name: '多租户' },
              { value: 435, name: '多角色' },
              { value: 580, name: '多数据库' },
              { value: 280, name: '主从分库' },
              { value: 284, name: '国际化' },
              { value: 300, name: 'App/H5开发' },
              { value: 200, name: 'Redis' },
              { value: 600, name: 'Sqlserver' },
              { value: 400, name: 'Mysql' },
              { value: 100, name: 'Oracle' },
          ],
          emphasis: {
              itemStyle: {
                  shadowBlur: 10,
                  shadowOffsetX: 0,
                  shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
          }
      }
  ]
}
var chart5={
title: {
  text: '    近一周各原料消耗统计'
},
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      // Use axis to trigger tooltip
      type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
    }
  },
  legend: {},
  grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      top:'13%',
      containLabel: true
  },
  xAxis: {
    type: 'value'
  },
  yAxis: {
    type: 'category',
    data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
  },
  series: [
    {
      name: '原料',
      type: 'bar',
      stack: 'total',
      label: {
        show: true
      },
      emphasis: {
        focus: 'series'
      },
      data: [320, 302, 301, 334, 390, 330, 320]
    },
    {
      name: '合金料',
      type: 'bar',
      stack: 'total',
      label: {
        show: true
      },
      emphasis: {
        focus: 'series'
      },
      data: [120, 132, 101, 134, 90, 230, 210]
    },
    {
      name: '返回料',
      type: 'bar',
      stack: 'total',
      label: {
        show: true
      },
      emphasis: {
        focus: 'series'
      },
      data: [220, 182, 191, 234, 290, 330, 310]
    }
  ]
}

var chart4 = {
  color: ['#37A2FF', '#FFBF00', '#80FFA5'],
  title: {
    text: '近一周各原料消耗统计'
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross',
      label: {
        backgroundColor: '#6a7985'
      }
    }
  },
  legend: {
    data: ['原料', '合金料', '返回料']
  },
  toolbox: {
    feature: {
      saveAsImage: {}
    }
  },
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  xAxis: [
    {
      type: 'category',
      boundaryGap: false,
      data: ['2023-06-01', '2023-06-02', '2023-06-03', '2023-06-04', '2023-06-05', '2023-06-06', '2023-06-07']
    }
  ],
  yAxis: [
    {
      type: 'value'
    }
  ],
  series: [
    {
      name: '原料',
      type: 'line',
      stack: 'Total',
      smooth: true,
      lineStyle: {
        width: 0
      },
      showSymbol: false,
      areaStyle: {
        opacity: 0.8,
        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
          {
            offset: 0,
            color: 'rgb(55, 162, 255)'
          },
          {
            offset: 1,
            color: 'rgb(116, 21, 219)'
          }
        ])
      },
      emphasis: {
        focus: 'series'
      },
      data: [320, 132, 201, 334, 190, 130, 220]
    },
    {
      name: '合金料',
      type: 'line',
      stack: 'Total',
      smooth: true,
      lineStyle: {
        width: 0
      },
      showSymbol: false,
      areaStyle: {
        opacity: 0.8,
        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
          {
            offset: 0,
            color: 'rgb(255, 191, 0)'
          },
          {
            offset: 1,
            color: 'rgb(224, 62, 76)'
          }
        ])
      },
      emphasis: {
        focus: 'series'
      },
      data: [120, 282, 111, 234, 220, 340, 310]
    },
    {
      name: '返回料',
      type: 'line',
      stack: 'Total',
      smooth: true,
      lineStyle: {
        width: 0
      },
      showSymbol: false,
      areaStyle: {
        opacity: 0.8,
        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
          {
            offset: 0,
            color: 'rgb(128, 255, 165)'
          },
          {
            offset: 1,
            color: 'rgb(1, 191, 236)'
          }
        ])
      },
      emphasis: {
        focus: 'series'
      },
      data: [140, 232, 101, 264, 90, 340, 250]
    }
  ]
};
export { chart1, chart2, chart3,chart4 }